<?php
class TestResult {
  const SUCCESS =    'SUCCESS';
  const FAILURE =    'FAILURE';
  const ERROR =      'ERROR';
  const INCOMPLETE = 'INCOMPLETE';
  
  private $result;
  private $class; 
  private $name;
  private $arAttributes;
  private $errorType;
  private $errorMessage;
  private $errorAttributes;
  
  function __construct($class,$name,$arAttributes) {
    $this->class = $class;
    $this->name = $name;
    $this->arAttributes = $arAttributes;
  }
  
  function setResult($result) {
    $this->result = $result;
  }
  
  function getClass() {
    return $this->class;
  }
  
  function getName() {
    return $this->name;
  }
  
  function getResult() {
    return $this->result;
  }
  
  function getAttributes() {
    return $this->arAttributes;
  }
  
  function getErrorType() {
    return $this->errorType;
  }
  
  function getErrorMessage() {
    return $this->errorMessage;
  }
  
  function getErrorAttributes() {
    return $this->errorAttributes;
  }
  
  function hasResult() {
    return (boolean)$this->result;
  }
  
  function setError($errorType, $errorMessage, $errorAttributes) {
    $this->errorType = $errorType;
    $this->errorMessage = $errorMessage;
    $this->errorAttributes = $errorAttributes;
  }
  
  static function getPossibleResults() {
    return array(self::ERROR,self::FAILURE,self::INCOMPLETE,self::SUCCESS);
  }
  
}
?>